# number_video/models.py
from django.db import models


class GeneratedVideo(models.Model):
    """
    存储生成的视频信息
    """
    # 视频标题
    title = models.CharField(max_length=200, verbose_name="视频标题")

    # 视频链接
    video_url = models.URLField(max_length=500, verbose_name="视频链接")

    # 用于生成视频的提示词
    prompt = models.TextField(verbose_name="生成提示词")

    # 创建时间
    created_at = models.DateTimeField(auto_now_add=True, verbose_name="创建时间")

    class Meta:
        db_table = 'generated_videos'
        verbose_name = '生成的视频'
        verbose_name_plural = '生成的视频'
        ordering = ['-created_at']

    def __str__(self):
        return self.title
